package com.wuxiaofan.member.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.member.entity.IntegrationChangeHistory;
import com.wuxiaofan.member.entity.custom.IntegrationChangeHistoryCustom;
import com.wuxiaofan.member.mapper.IntegrationChangeHistoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.member.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class IntegrationChangeHistoryService {
    @Autowired
    private IntegrationChangeHistoryMapper umsIntegrationChangeHistoryMapper;
    @Resource
    private Idgenerator idgenerator;
    public IntegrationChangeHistory findById(String id){
        return umsIntegrationChangeHistoryMapper.selectById(id);
    }

    public IntegrationChangeHistoryCustom findCountByMap(Map paraMap){
        return umsIntegrationChangeHistoryMapper.findCountByMap(paraMap);
    }

    public IntegrationChangeHistoryCustom findGroupByMap(Map paraMap){
        return umsIntegrationChangeHistoryMapper.findGroupByMap(paraMap);
    }

    public List<IntegrationChangeHistoryCustom> findByMap(Map paraMap){
        return umsIntegrationChangeHistoryMapper.findByMap(paraMap);
    }

    public Page<IntegrationChangeHistoryCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(umsIntegrationChangeHistoryMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        umsIntegrationChangeHistoryMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        umsIntegrationChangeHistoryMapper.deleteById(id);
    }

    public IntegrationChangeHistory save(IntegrationChangeHistory umsIntegrationChangeHistory){
        umsIntegrationChangeHistory.setId(idgenerator.getId());
        umsIntegrationChangeHistoryMapper.insert(umsIntegrationChangeHistory);
        return umsIntegrationChangeHistory;
    }

}
